﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace MvcShop.Models.ViewDataModels
{
    public partial class UserToRoleModel
    {
        public int UserRoleId { get; set; }
        public int UserId { get; set; }
        public int RoleId { get; set; }
        public string UserName { get; set; }
        public string RolesName { get; set; }
    }

    [MetadataType(typeof(UserToRoleModelMetadata))]
    public partial class UserToRoleModel
    { }

    public class UserToRoleModelMetadata
    {
        [DisplayName("用户ID")]
        [Required(ErrorMessage = "用户ID不能空。")]
        [Range(1,100000000)]
        public int UserId { get; set; }

        [DisplayName("角色ID")]
        [Required(ErrorMessage = "角色ID不能空。")]
        public int RoleId { get; set; }

        [DisplayName("用户名称")]
        [Required(ErrorMessage = "用户名称不能空。")]
        public string UserName { get; set; }

        [DisplayName("角色名称")]
        [Required(ErrorMessage = "角色名称不能空。")]
        public string RolesName { get; set; }
    }

    public class FControllerAction
    {
        public int ControllerActionId { get; set; }
        public string Name { get; set; }
        public string ControlerName { get; set; }
        public string ActionDescription { get; set; }
        public bool IsAllowed { get; set; }
    }
}
